<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="main-content">
    <div class="box box-main">
        <form id="troubleForm" model="post" action="<c:url value="/web/admin/repairLevel/addOrUpdate.action"/>"
              method="post" class="form-horizontal">
            <div class="box-body">
                <div class="form-unit">基本信息</div>
                <input type="hidden" name="createDate" value="<fmt:formatDate value="${repairLevel.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
                <input type="hidden" name="id" value="${repairLevel.id}"/>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required">*</span>程度名称：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="grade" name="grade" value="${repairLevel.grade}"
                                       class="form-control required">
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                 需求到场距创建时间（分钟）：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="presence" name="presence" value="${repairLevel.presenceTime}" min="1" type="number" step="1"
                                       maxlength="100" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                 需求完成距创建时间（分钟）：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="finish" name="finish" value="${repairLevel.finishTime}" maxlength="100"  min="1" type="number" step="1"
                                       class="form-control ">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i>
                            保 存
                        </button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i
                                class="fa fa-times"></i> 关 闭
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#troubleForm").validate({
        submitHandler: function (form) {
            js.ajaxSubmitForm($(form), function (data) {
                js.showMessage(data.msg);
                if (data.status == Global.NO) {
                    closeView();
                    $('#dataGrid').dataGrid("refresh");
                }
            }, "json");
        }
    });

    function closeView() {
        layer.close(LayWin['wRepairLevel']);
    }
</script>


